﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sahit.iSoilHotel.Portal.ServiceProxy.Tavern.Models.Room;
using Sahit.iSoilHotel.Portal.ServiceProxy.Tavern.Models.Price;
using Sahit.iSoilHotel.Portal.ServiceProxy.Tavern.Models.Customer;
using System.ComponentModel;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using Sahit.iSoilHotel.Portal.ServiceProxy.Common;
using Webdiyer.WebControls.Mvc;
using Sahit.iSoilHotel.ServiceProxy.Tavern.Models.Customer;
using FluentValidation.Attributes;

namespace Sahit.iSoilHotel.Portal.ServiceProxy.Tavern.Models.Record
{
    public class RecordModel : EntityModel
    {
        public RecordModel()
        {
                
        }
        public virtual DateTime StartDate { get; set; }
        public virtual DateTime EndDate { get; set; }
        public virtual RoomModel Room { get; set; }
        public virtual PriceModel Price { get; set; }
        public virtual PriceCodeModel PriceCode { get; set; }
        public virtual int StatusID { get; set; }
        public virtual string Status { get; set; }
        public virtual CustomerModel MainCustomer
        {
            get
            {
                if (Customers == null || Customers.Count == 0)
                    return new CustomerModel();
                return Customers.FirstOrDefault();
            }
            set
            {
                if (Customers.Count == 0)
                    Customers.Add(value);
                else Customers[0] = value;
            }
        }
        public virtual List<CustomerModel> Customers { get; set; }
    }
}
